package com.nuc.thread.jmmtest;

import lombok.extern.slf4j.Slf4j;

/**
 * @author 诗酒趁年华
 * @version 1.0.0
 * @Description
 * @createTime 2021年07月10日 17:22:00
 */
@Slf4j
public class Test2 {
    static volatile boolean flag = true;
    public static void main(String[] args) throws InterruptedException {
        new Thread(()->{
            while (flag){
            }
        },"t1").start();

        Thread.sleep(1000);
        flag = false;//
    }
}
